package musika;

import java.awt.EventQueue;

import javax.swing.JFrame;
import java.awt.FlowLayout;
import javax.swing.JLabel;
import javax.swing.JButton;
import java.awt.event.ActionListener;
import java.awt.event.ActionEvent;
import java.awt.event.WindowEvent;

public class EI_GordeNahi extends JFrame {

	private JFrame frmMusikebal;
	boolean ireki;

	/**
	 * Launch the application.
	 */
	public static void main(String[] args) {
		EventQueue.invokeLater(new Runnable() {
			public void run() {
				try {
					EI_GordeNahi window = new EI_GordeNahi(false);
					window.frmMusikebal.setVisible(true);
				} catch (Exception e) {
					e.printStackTrace();
				}
			}
		});
	}

	/**
	 * Create the application.
	 */
	public EI_GordeNahi(boolean ireki) {
		initialize();
		frmMusikebal.setVisible(true);
		this.ireki=ireki;
	}

	/**
	 * Initialize the contents of the frame.
	 */
	private void initialize() {
		frmMusikebal = new JFrame();
		frmMusikebal.setTitle("MusikEbal");
		frmMusikebal.setBounds(100, 100, 308, 141);
		frmMusikebal.setDefaultCloseOperation(JFrame.DISPOSE_ON_CLOSE);
		frmMusikebal.getContentPane().setLayout(null);
		
		JLabel lblAldaketakGordeNahi = new JLabel("Aldaketak gorde nahi dituzu?");
		lblAldaketakGordeNahi.setBounds(37, 12, 208, 15);
		frmMusikebal.getContentPane().add(lblAldaketakGordeNahi);
		
		JButton btnBai = new JButton("Bai");
		btnBai.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				
				Kudeatzailea k1=Kudeatzailea.getInstantzia();
				k1.artxiboaGorde();
				
				if (ireki==true){
					
					new EI_ArtxiboBerria();
					frmMusikebal.setVisible(false);
					
				}else{
					
					System.exit(-1);
					
				}
				

				
				
			}
		});
		btnBai.setBounds(37, 70, 103, 25);
		frmMusikebal.getContentPane().add(btnBai);
		
		JButton btnEz = new JButton("Ez");
		btnEz.addActionListener(new ActionListener() {
			public void actionPerformed(ActionEvent arg0) {
				
				if (ireki==true){
					
					new EI_ArtxiboBerria();
					frmMusikebal.setVisible(false);
					
				}else{
					
					System.exit(-1);
					
				}
			}
		});
		btnEz.setBounds(151, 70, 103, 25);
		frmMusikebal.getContentPane().add(btnEz);
	}


}
